<template>
  <div class="visitor">
    <div class="top">
      <p class="title">实时游客统计</p>
      <p class="bg"></p>
      <p class="right">可预约总量<span>99999</span>人</p>
    </div>
    <div class="number">
      <span v-for="(item, index) in people" :key="index">{{ item }}</span>
    </div>
    <!-- 将来展示v-charts图表的地方 -->
    <div class="charts" ref="charts">

    </div>
  </div>
</template>

<script setup lang='ts'>
import { onMounted, ref } from 'vue';
let people = ref('2108069人')
import * as echarts from 'echarts'
import 'echarts-liquidfill'
// 获取节点
let charts = ref()
onMounted(() => {
  // 获取echarts类的实例
  let mycharts = echarts.init(charts.value)
  // 设置实例的配置项
  mycharts.setOption({
    // 标题组件
    title: {
    },
    // 系列：决定你展示什么样的图形
    series: {
      type: 'liquidFill',
      data: [0.6, 0.5, 0.4, 0.3],
      waveAnimation: true,
      animationDuration: 0,
      animationDurationUpdate: 0,
      radius: '90%',
    },
    // 布局组件
    grid: {

    },
  })
})
</script>

<style scoped lang="scss">
.visitor {
  margin-top: 20px;
  background: url(../../../images/dataScreen-main-lb.png) no-repeat;
  background-size: 100% 100%;

  .top {
    margin-left: 20px;

    .title {
      color: white;
      font-size: 20px;
    }

    .bg {
      margin-top: 10px;
      width: 68px;
      height: 7px;
      background: url(../../../images/dataScreen-title.png) no-repeat;
      background-size: 100% 100%;

    }

    .right {
      float: right;
      color: white;
      font-size: 18px;

      span {
        color: yellow;
      }
    }
  }

  .number {
    margin-top: 30px;
    display: flex;
    padding: 0 10px;

    span {
      margin-top: 20px;
      text-align: center;
      line-height: 45px;
      height: 45px;
      flex: 1;
      background: url(../../../images/total.png)no-repeat;
      background-size: 100% 100%;
      color: #29fcff;
    }
  }

  .charts {
    margin-top: 10px;
    width: 100%;
    height: 230px;
  }
}
</style>